const enrollModel = require("../models/enrollModel");
const {getDataByPage} = require("../utils/tools");


/**
 * 报名
 * @param enrollInfo
 * @returns {*}
 */
exports.createEnroll = (enrollInfo)=>{
    return enrollModel.create(enrollInfo)
}

/**
 * 更新报名信息
 * @param id
 * @param enrollInfo
 * @returns {*}
 */
exports.updateEnroll = (id,enrollInfo)=>{
    return enrollModel.updateOne({
        _id:id
    },enrollInfo)
}

/**
 * 分页获取企业
 * @param queryCollection
 * @returns {Promise<{current: number, pageSize: number}>}
 */
exports.findByPageEnroll = (queryCollection)=>{
    return getDataByPage(enrollModel,queryCollection,"user","recruitInfo")
}

